import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooFaqController } from '../../../controllers';
const uctoofaqRouter = new Router();
const faqController = new uctooFaqController();

uctoofaqRouter.post('/add', requireUser, faqController.add);
uctoofaqRouter.post('/edit', requireUser, rowLevelPermission('uctoo/faq'), faqController.edit);
uctoofaqRouter.post('/del', requireUser, rowLevelPermission('uctoo/faq'), faqController.delete);

//For getting faq with permission control
uctoofaqRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/faq'), faqController.getSingle);
uctoofaqRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/faq'), faqController.getMany);
uctoofaqRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/faq'), faqController.getMany);

//#endregion AutoCreateCode
export default uctoofaqRouter;
